package com.cz.video.common.core.domain.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.cz.video.common.annotation.LegalContent;
import com.cz.video.common.xss.Xss;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import java.io.Serial;
import java.io.Serializable;

/**
 * 登录用户身份权限
 *
 * @author Lion Li
 */

@Data
@NoArgsConstructor
public class WebsiteLoginUser  implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    @TableId(value = "account_id")
    private Long accountId;

    @Schema(description = "用户名")
    private String username;

    @Schema( description = "用户密码")
    private String password;

    @LegalContent
    @Xss(message = "不可以")
    @Schema( description = "账户描述")
    private String accountDesc;

    @Schema( description = "用户的昵称")
    @Length(max = 13,message = "昵称长度不能超过{max}个字符")
    private String nickname;

    @Schema( description = "用户的头像地址")
    private String avatar;

    @Email(message = "邮箱格式不正确")
    @Schema( description = "用户的邮箱地址")
    private String email;

    @Schema( description = "是否允许评论")
    private Integer isAllowComment;

    @Schema( description = "状态,0：正常，1：禁用")
    private String status;

    @TableLogic
    @Schema( description = "删除标志")
    private Integer delFlag;

}
